package com.lolaage.tracks.adapter;

import android.location.Location;
import android.util.Log;

import com.lolaage.tracks.MyLocationValider;

/*********************************************************
 * @author : zhaohua
 * @version : 2012-9-19
 * @see : 轨迹的合法判断者
 * @Copyright : copyrights reserved by personal 2007-2011
 **********************************************************/
public class TrackLocationValider implements MyLocationValider
{
    private static final String TAG = "TrackLocationValider";
    protected int minRequiredAccuracy = 200;
    
    @Override
    public boolean isBetterLocation(Location currentBestLocation, Location location)
    {
        if(location == null) return false;
        if(currentBestLocation == null && location != null) return true;
        if (location.getAccuracy() > minRequiredAccuracy) 
        {
            Log.d(TAG, "Ignore onLocationChangedAsync. Poor accuracy.");
            return false;
        }
        return true;
    }
}
